package com.huike.stock_analysis.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huike.stock_analysis.service.OverviewService;

/**
 * 
 * @author mzLEI
 * 总体概览接口
 */
@RestController
@CrossOrigin(value = "*")
public class OverviewController {
	@Autowired
	private OverviewService oService;
	@RequestMapping("/radar")
	private String radar(String stock) {
		if(stock == null) return "null";
		List<String> radar = oService.radar(stock);
		ObjectMapper mapper = new ObjectMapper();
		
		String result = "";
		try {
			result = mapper.writeValueAsString(radar);
		} catch (JsonProcessingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return result;
		
	}
}
